Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mnemonist

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mnemonist

Curated collection of data structures for the JavaScript/TypeScript.

  • 0.39.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.4M
decreased by-13.46%
Maintainers
1
Weekly downloads
 
Created

What is mnemonist?

The mnemonist package is a collection of data structures for JavaScript and TypeScript. It provides a variety of advanced data structures that are not available in the standard JavaScript library, allowing developers to handle complex data manipulation tasks more efficiently.

What are mnemonist's main functionalities?

FibonacciHeap

FibonacciHeap is a heap data structure that allows for efficient retrieval and modification of the minimum element. It is particularly efficient for mergeable heap operations.

const { FibonacciHeap } = require('mnemonist');
const heap = new FibonacciHeap();
heap.push(3, 'three');
heap.push(1, 'one');
heap.pop(); // -> 'one'

Trie

Trie is a tree-like data structure that is used to store a dynamic set or associative array where the keys are usually strings. It is useful for tasks like autocomplete where prefix-based search is needed.

const { Trie } = require('mnemonist');
const trie = new Trie();
trie.add('cat');
trie.add('can');
trie.has('cat'); // -> true

SuffixArray

SuffixArray is a data structure that provides an efficient way to search for substrings within a given string. It is useful for text processing and search applications.

const { SuffixArray } = require('mnemonist');
const suffixArray = new SuffixArray('banana');
suffixArray.search('ana'); // -> [1, 3]

BKTree

BKTree is a tree data structure for approximate string matching. It is useful for spell checking, fuzzy searching, and other applications where you need to find strings that are similar to a target string.

const { BKTree } = require('mnemonist');
const tree = new BKTree(levenshtein);
tree.add('book');
tree.add('back');
tree.search('bock', 2); // -> [{word: 'book', distance: 1}, {word: 'back', distance: 1}]

Other packages similar to mnemonist

Keywords

FAQs

Package last updated on 02 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc